package com.lzx.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.context.annotation.Bean;

import java.io.Serializable;
import java.util.Objects;

/**
 * <p>
 * 
 * </p>
 *
 * @author lzx
 * @since 2020-12-20
 */
public class Ip implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String url;

    private Integer port;

    private String header;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public Ip(Integer id, String url, Integer port, String header) {
        this.id = id;
        this.url = url;
        this.port = port;
        this.header = header;
    }
    public Ip() {}

    @Override
    public String toString() {
        return "Ip{" +
                "id=" + id +
                ", url='" + url + '\'' +
                ", port=" + port +
                ", header='" + header + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Ip ip = (Ip) o;
        return Objects.equals(id, ip.id) &&
                Objects.equals(url, ip.url) &&
                Objects.equals(port, ip.port) &&
                Objects.equals(header, ip.header);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, url, port, header);
    }
}
